package com.yonyou.cloud.member.adapters.repository.orm;

import com.yonyou.cloud.member.adapters.repository.orm.dao.CouponDao;
import com.yonyou.cloud.member.domainmodel.entities.coupon.Coupon;
import com.yonyou.cloud.member.domainmodel.vo.CouponId;
import com.yonyou.cloud.member.domainmodel.entities.coupon.CouponStatusEnum;
import com.yonyou.cloud.member.domainmodel.vo.MemberId;
import com.yonyou.cloud.member.domainmodel.repositories.CouponRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class CouponRepositoryImpl implements CouponRepository {
    @Autowired
    CouponDao couponDao;

    @Override
    public Coupon find(CouponId couponId) {
        return couponDao.find(couponId);
    }

    @Override
    public List<Coupon> listByMember(MemberId memberId) {
        return couponDao.listByMember(memberId);
    }

    @Override
    public boolean updateStatus(CouponId couponId, CouponStatusEnum status) {
        return couponDao.updateStatus(couponId, status);
    }

    @Override
    public boolean reset() {
        return couponDao.reset();
    }
}
